/*
 * UnitAspect.h
 *
 *  Created on: Oct 15, 2008
 *      Author: Ryan
 */

#ifndef UNITASPECT_H_
#define UNITASPECT_H_

#include "../../Object.h"
#include "../../../Interfaces/UnitVisitor.h"

#include "../../../boostPtrNames.h"

namespace OOInterface
{

/**
 * UnitAspect is the root of the Aspect hierarchy for Units. A UnitAspect
 * is intended to group closely related concepts of a Unit into one object
 * and then be used to compose a Units true form.
 *
 * Example: Amphibious Units are a composition of LandAspect and WaterAspect
 * 				(potentially more aspects).
 *
 * This avoids the combinatorial explosion of subclasses that would be necessary
 * to represent the different combinations a Unit can be. Additionally, any
 * state information pertaining to a certain aspect is localized into one spot.
 *
 */
class UnitAspect: public Object
{
public:
	virtual void accept( UnitVisitor& v ) const = 0;

	const Unit* getParentUnit() const { return _parentUnit; }
	void setParentUnit( const Unit* parent ) const { _parentUnit = parent; }

private:
	mutable const Unit* _parentUnit; //TODO: this is bad
};

}

#endif /* UNITASPECT_H_ */
